import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'

/**
 * 所有权限
 * @returns {*}
 */
export const allpermission = () => {
  return axios.request({
    url: '/admin/permission/query/all/',
    method: 'get',
    dataType: 'json',
    headers: {
      'Content-Type': 'text/html; charset=UTF-8',
      'token': getToken()
    }
  })
}
/**
 * 用户权限查询
 * @param param
 * @returns {*}
 */
export const permissionbyuser = (param) => {
  return axios.request({
    url: '/admin/permission/query/by/user/' + param,
    method: 'get',
    dataType: 'json',
    headers: {
      'Content-Type': 'text/html; charset=UTF-8',
      'token': getToken()
    },
  })
}
